Conversation
managed/raw/buffering
irods/manager/data_object_manager.py
Outdated
| allow_redirect=client_config.getter("data_objects", "allow_redirect"), | ||
| **options | ||
| ): | ||
| if buffering < 0: |
There was a problem hiding this comment.
always true? since set to -1 just above?
There was a problem hiding this comment.
The buffering = -1 was in a parameter declaration, so here it means a parameter named buffering with a default value of 1. Admittedly an ambiguity from a human standpoint, and the reason many early languages like Pascal chose := instead of = for their assignment operators.
There was a problem hiding this comment.
... so here it means a parameter named
bufferingwith a default value of 1.
I don't understand. The default value is -1, based on the function signature. Am I misunderstanding something?
What values are considered valid for the buffering parameter?
korydraughn
left a comment
There was a problem hiding this comment.
How does this code change play with existing PRC applications?
|
|
||
|
|
||
| class ManagedBufferedRandom(io.BufferedRandom): | ||
| def managed_class(cls): |
There was a problem hiding this comment.
Is this private to the implementation? i.e. Should users of the library ever reach for this? If not, consider adding a leading underscore to signal that to the reader.
| m_BufferedRandom = managed_class(io.BufferedRandom) | ||
| m_iRODSDataObjectFileRaw = managed_class(iRODSDataObjectFileRaw) |
There was a problem hiding this comment.
Are these private to the implementation? i.e. Should users of the library ever reach for this? If not, consider adding a leading underscore to signal that to the reader.
irods/manager/data_object_manager.py
Outdated
| allow_redirect=client_config.getter("data_objects", "allow_redirect"), | ||
| **options | ||
| ): | ||
| if buffering < 0: |
There was a problem hiding this comment.
... so here it means a parameter named
bufferingwith a default value of 1.
I don't understand. The default value is -1, based on the function signature. Am I misunderstanding something?
What values are considered valid for the buffering parameter?
|
|
||
|
|
||
| class ManagedBufferedRandom(io.BufferedRandom): | ||
| def managed_class(cls): |
There was a problem hiding this comment.
Needs a line or two explaining what this is for.
… correctly. line buffering only applicable in cases of e.g. TextIOWrapper opened via iRODSFS (https://github.com/d-w-moore/fs-irods@pass_root_path)
Open data object option raw | buffering , preserving option for auto_close in both cases.